unit crd_KindsmanEdit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, shbl_Card, ActnList, ComCtrls, ToolWin, StdCtrls, Buttons,
  ExtCtrls, DBCtrls, DBGridEh, Mask, DBCtrlsEh, DBLookupEh, DB, FIBDataSet,
  pFIBDataSet, FIBDatabase, pFIBDatabase, PropFilerEh, PropStorageEh;

type
  TcrdKindsmanEdit = class(TshblCard)
    Label4: TLabel;
    Label5: TLabel;
    DBDateTimeEditEh1: TDBDateTimeEditEh;
    DBDateTimeEditEh2: TDBDateTimeEditEh;
    dsKindsman: TpFIBDataSet;
    trKindsman: TpFIBTransaction;
    dscKindsman: TDataSource;
    Label3: TLabel;
    Label2: TLabel;
    Label6: TLabel;
    DBText1: TDBText;
    Label1: TLabel;
    DBText2: TDBText;
    DBText3: TDBText;
    DBText4: TDBText;
    dsKindsmanID: TFIBIntegerField;
    dsKindsmanNAME1: TFIBStringField;
    dsKindsmanRELATION1: TFIBStringField;
    dsKindsmanNAME2: TFIBStringField;
    dsKindsmanRELATION2: TFIBStringField;
    dsKindsmanBDATE: TFIBDateField;
    dsKindsmanEDATE: TFIBDateField;
    DBCheckBoxEh1: TDBCheckBoxEh;
    dsKindsmanNEAR_RELATION: TFIBSmallIntField;
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure aSaveExecute(Sender: TObject);
    procedure aCancelExecute(Sender: TObject);
  private
    { Private declarations }
  public
    Client_id, Fam:integer;
  end;

var
  crdKindsmanEdit: TcrdKindsmanEdit;

implementation

uses crd_Tenant, frm_FindClients, uDM;

{$R *.dfm}

procedure TcrdKindsmanEdit.FormCreate(Sender: TObject);
begin
  Client_id := 0;
  Fam := 0;
end;

procedure TcrdKindsmanEdit.FormShow(Sender: TObject);
begin
  dsKindsman.ParamByName('pclient_id').Value := Client_id;
  dsKindsman.ParamByName('fam_id').Value := Fam;
  dsKindsman.Open;
  dsKindsman.Edit;
end;

procedure TcrdKindsmanEdit.aSaveExecute(Sender: TObject);
begin
  dsKindsman.Post;
  dsKindsman.Transaction.Commit;
  ModalResult := mrOk;
end;

procedure TcrdKindsmanEdit.aCancelExecute(Sender: TObject);
begin
  ModalResult := mrCancel;
end;

end.
